<?php 
include("../JO_02_function.php");
include("../JO_01_configuration.php");
$JO_MySQL = new mysqli( $JO_DB_host, $JO_DB_user, $JO_DB_password, $JO_DB_database );
$JO_MySQL -> query( "SET NAMES 'UTF8'" );
$key=isset($_GET['SO_chude'])?$_GET['SO_chude']:"";
if($key!=''){
$sql='Select * from `organization` where `organization`.`delete` is null and `organization`.`key`='.$key;

$result=JO_query($sql);
if($result->num_rows)
$row=$result->fetch_array();

   ?>
   	<form method="post" action="JO_05_execution.php" target="JO_integration_asynchronous" >
   <input type="hidden"						name="JO_query"				value="organzination"	 />
   <input type="hidden"						name="log"				value="<?=isset($row['log'])?$row['log']:""?>"/>
   <input type="hidden" name="id" value="<?=isset($row['key'])?$row['key']:""?>"   style="width:480px !important"/>				
	<table>
   
                <tr>
                  <th style="vertical-align:middle;width:70px"> <div style="width:60px;float:left">name</div></th>
                    <td colspan="3"><div  style="width:100px;float:left;padding-left:0;" id="input">
                      <ul class="token-input-list">
                        <li class="token-input-token">
                          <p id="boc">
                            <?=isset($row['name'])?$row['name']:""?>
                          </p>
                          <input type="hidden" name="log" value="<?=isset($row['log'])?$row['log']:""?>" />
                          <input type="hidden" name="name" value="<?=isset($row['name'])?$row['name']:""?>" />
                          <span class="token-input-delete-token" onclick="tat('')">X</span> </li>
                        </ul>
                      </div>
                      </td>
                  </tr>
                    <tr>
                        <th style="vertical-align:middle;width:70px">	<div style="width:20px;float:left">Address</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="address"  value="<?=isset($row['address'])?$row['address']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tbody id="extendcontent" style="display:none;">
                      <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Parent</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="parent"  value="<?=isset($row['parent'])?$row['parent']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Priority</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text"  name="prio" value="<?=isset($row['priority'])?$row['priority']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">account</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text"  name="account" value="<?=isset($row['account'])?$row['account']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Type</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="type"  value="<?=isset($row['type'])?$row['type']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Phone</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="phone"  value="<?=isset($row['phone'])?$row['phone']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Nation</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="nation"   value="<?=isset($row['nation'])?$row['nation']:""?>"  style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Decription</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="des"  value="<?=isset($row['description'])?$row['description']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Note</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="note" value="<?=isset($row['note'])?$row['note']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                      <th style="vertical-align:middle;width:60px"> <div style="width:60px;float:left">Update</div>
                      </th>
                      <td colspan="4"><div  style="width:424px;float:left;padding-left:0">
                
                          <label><?=isset($row['update'])?$row['update']:""?></label>
                        </div></td>
                    </tr>
                    </tbody>
                    <tr class="trextend">
                    	<th style="vertical-align:middle;width:70px">	<div style="width:20px;float:left"><input  type="button" value="Extend"  id="tab" class="JO_button"   onclick="show();"/></div>					</th>
                    	<td width="246px"><input type="submit" value="Submit"  id="submit" class="JO_button"   style="width:240px !important" /></td>
                        <td style="padding-left:0 !important"><input type="button" value="Cancel"  id="cancel" class="JO_button"   style="width:240px !important" onClick="move();"/></td>
                    </tr>
                    
            </table>
             </form>
                  <?php  }if($key==''){ ?>
	<form method="post" action="JO_05_execution.php" target="JO_integration_asynchronous" >
   <input type="hidden"						name="JO_query"				value="insert_organzination"	 />
   <input type="hidden" name="id" value="<?=isset($row['key'])?$row['key']:""?>"   style="width:480px !important"/>	
                  	<table>
   		
               <tr>
                  <th style="vertical-align:middle;width:70px"> <div style="width:60px;float:left">name</div></th>
                    <td colspan="3"><div  style="width:100px;float:left;padding-left:0;" id="input">
                      <ul class="token-input-list">
                        <li class="token-input-token">
                          <p id="boc">
                            <?=isset($row['name'])?$row['name']:""?>
                          </p>
                          <input type="hidden" name="log" value="<?=isset($row['log'])?$row['log']:""?>" />
                          <input type="hidden" name="name" value="<?=isset($row['name'])?$row['name']:""?>" />
                          <span class="token-input-delete-token" onclick="tat('')">X</span> </li>
                        <li class="token-input-input-token">
                          
                        </li>
                      </ul>
                      </div>
                      </td>
                  </tr>
                    <tr>
                        <th style="vertical-align:middle;width:70px">	<div style="width:20px;float:left">Address</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="address"  value="<?=isset($row['address'])?$row['address']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tbody id="extendcontent" style="display:none;">
                      <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Parent</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="parent"  value="<?=isset($row['parent'])?$row['parent']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Priority</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text"  name="prio" value="<?=isset($row['priority'])?$row['priority']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">account</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text"  name="account" value="<?=isset($row['account'])?$row['account']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Type</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="type"  value="<?=isset($row['type'])?$row['type']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                     <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Phone</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="phone"  value="<?=isset($row['phone'])?$row['phone']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Nation</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="nation"   value="<?=isset($row['nation'])?$row['nation']:""?>"  style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Decription</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="des"  value="<?=isset($row['description'])?$row['description']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    <tr>
                    	<th style="vertical-align:middle;width:60px">	<div style="width:20px;float:left">Note</div>					</th>
                        <td colspan="2">	<div  style="width:424px;float:left;padding-left:0"><input type="text" name="note" value="<?=isset($row['note'])?$row['note']:""?>"   style="width:480px !important"/></div></td>
                    </tr>
                    </tbody>
                    <tr class="trextend">
                    	<th style="vertical-align:middle;width:70px">	<div style="width:20px;float:left"><input  type="button" value="Extend"  id="tab" class="JO_button"   onclick="show();"/></div>					</th>
                    	<td width="246px"><input type="submit" value="Submit"  id="submit" class="JO_button"   style="width:240px !important" /></td>
                        <td style="padding-left:0 !important"><input type="button" value="Cancel"  id="cancel" class="JO_button"   style="width:240px !important" onClick="move2();"/></td>
                    </tr>
                  
            </table>
                 </form>    
                  <?php } ?>